﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NowFundList.aspx.cs" Inherits="FundYield_SZPLZD_NowFundList" %>
<%@ Register Assembly="am.Charts" Namespace="am.Charts" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script src="../../Script/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
	<script type="text/javascript" language="javascript" >
	    function json2string(strObject) {
	        var c, i, l, s = '', v, p;

	        switch (typeof strObject) {
	            case 'object':
	                if (strObject) {
	                    if (strObject.length && typeof strObject.length == 'number') {
	                        for (i = 0; i < strObject.length; ++i) {
	                            v = json2string(strObject[i]);
	                            if (s) {
	                                s += ',';
	                            }
	                            s += v;
	                        }
	                        return '[' + s + ']';
	                    } else if (typeof strObject.toString != 'undefined') {
	                        for (i in strObject) {
	                            v = strObject[i];
	                            if (typeof v != 'undefined' && typeof v != 'function') {
	                                v = json2string(v);
	                                if (s) {
	                                    s += ',';
	                                }
	                                s += json2string(i) + ':' + v;
	                            }
	                        }
	                        return '{' + s + '}';
	                    }
	                }
	                return 'null';
	            case 'number':
	                return isFinite(strObject) ? String(strObject) : 'null';
	            case 'string':
	                l = strObject.length;
	                s = '"';
	                for (i = 0; i < l; i += 1) {
	                    c = strObject.charAt(i);
	                    if (c >= ' ') {
	                        if (c == '\\' || c == '"') {
	                            s += '\\';
	                        }
	                        s += c;
	                    } else {
	                        switch (c) {
	                            case '\b':
	                                s += '\\b';
	                                break;
	                            case '\f':
	                                s += '\\f';
	                                break;
	                            case '\n':
	                                s += '\\n';
	                                break;
	                            case '\r':
	                                s += '\\r';
	                                break;
	                            case '\t':
	                                s += '\\t';
	                                break;
	                            default:
	                                c = c.charCodeAt();
	                                s += '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
	                        }
	                    }
	                }
	                return s + '"';
	            case 'boolean':
	                return String(strObject);
	            default:
	                return 'null';
	        }
	    }
	</script>
		<script type="text/javascript" language="javascript">
		    function GATButton() {
		        $("#NowFundList").html("");
		        var text = "4897b442-8806-4cc2-922d-b868fc54ed44";
		        var formativeData = { "zdid": text };
		        var jsonStr = json2string(formativeData);

		        $.ajax({
		            type: "POST",
		            url: "http://localhost:9162/FundYield.svc/GetNowFundList",
		            contentType: "application/json;charset=utf-8",
		            data: jsonStr,
		            success: function(data) {
		                var div = document.getElementById("NowFundList");
		                div.innerHTML += "<table>";
		                div.innerHTML += "<tr>";
		                div.innerHTML += "<td>ID</td>";
		                div.innerHTML += "<td>jjdm</td>";
		                div.innerHTML += "<td>bzdm</td>";
		                div.innerHTML += "<td>jjjc</td>";
		                div.innerHTML += "<td>tzdx</td>";
		                div.innerHTML += "<td>Nowshuhuiyingkui</td>";
		                div.innerHTML += "<td>Nowshouyilv</td>";
		                div.innerHTML += "<td>FirstBuyDay</td>";
		                div.innerHTML += "<td>avgcost</td>";
		                div.innerHTML += "<td>nowlot</td>";
		                div.innerHTML += "<td>Nowshizhi</td>";
		                div.innerHTML += "<td>Nowbenjin</td>";
		                div.innerHTML += "<td>Nowhongli</td>";
		                div.innerHTML += "<td>Nowyishuhui</td>";
		                div.innerHTML += "<td>jiufupf</td>";
		                div.innerHTML += "</tr>";
		                $.each(data, function(i) {
		                $(data).find("Table1").each(function() { 
alert($(this).find("ID").text()); }); 
		                    if (i > 30) return;
		                    div.innerHTML += "<tr>";
		                    div.innerHTML += "<td>" + data.Tables[0].Rows[i].id + "</td>";
		                    div.innerHTML += "<td>" + data[i].jjdm + "</td>";
		                    div.innerHTML += "<td>" + data[i].bzdm + "</td>";
		                    div.innerHTML += "<td>" + data[i].jjjc + "</td>";
		                    div.innerHTML += "<td>" + data[i].tzdx + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowshuhuiyingkui + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowshouyilv + "</td>";
		                    div.innerHTML += "<td>" + data[i].FirstBuyDay + "</td>";
		                    div.innerHTML += "<td>" + data[i].avgcost + "</td>";
		                    div.innerHTML += "<td>" + data[i].nowlot + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowshizhi + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowbenjin + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowhongli + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowyishuhui + "</td>";
		                    div.innerHTML += "<td>" + data[i].jiufupf + "</td>";
		                    div.innerHTML += "</tr>";
		                });
		            },
		            error: function(XMLHttpRequest, textStatus, errorThrown) {
		                alert(textStatus);
		            },
		            cache: false
		        });

	    }
	    
	     function GATButton2() {
		        $("#HistoryFundList").html("");
		        var text = "4897b442-8806-4cc2-922d-b868fc54ed44";
		        var formativeData = { "zdid": text };
		        var jsonStr = json2string(formativeData);

		        $.ajax({
		            type: "POST",
		            url: "http://localhost:9162/FundYield.svc/GetHistoryFundList",
		            contentType: "application/json;charset=utf-8",
		            data: jsonStr,
		            success: function(data) {
		                alert(data[0]);
		                var div = document.getElementById("NowFundList");
		                alert(data[0]);
		                div.innerHTML += "<table>";
		                div.innerHTML += "<tr>";
		                div.innerHTML += "<td>ID</td>";
		                div.innerHTML += "<td>jjdm</td>";
		                div.innerHTML += "<td>bzdm</td>";
		                div.innerHTML += "<td>jjjc</td>";
		                div.innerHTML += "<td>tzdx</td>";
		                div.innerHTML += "<td>Nowshuhuiyingkui</td>";
		                div.innerHTML += "<td>Nowshouyilv</td>";
		                div.innerHTML += "<td>FirstBuyDay</td>";
		                div.innerHTML += "<td>avgcost</td>";
		                div.innerHTML += "<td>nowlot</td>";
		                div.innerHTML += "<td>Nowshizhi</td>";
		                div.innerHTML += "<td>Nowbenjin</td>";
		                div.innerHTML += "<td>Nowhongli</td>";
		                div.innerHTML += "<td>Nowyishuhui</td>";
		                div.innerHTML += "<td>jiufupf</td>";
		                div.innerHTML += "</tr>";
		                $.each(data, function(i) {
		                    if (i > 30) return;
		                    div.innerHTML += "<tr>";
		                    div.innerHTML += "<td>" + data[i].ID + "</td>";
		                    div.innerHTML += "<td>" + data[i].jjdm + "</td>";
		                    div.innerHTML += "<td>" + data[i].bzdm + "</td>";
		                    div.innerHTML += "<td>" + data[i].jjjc + "</td>";
		                    div.innerHTML += "<td>" + data[i].tzdx + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowshuhuiyingkui + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowshouyilv + "</td>";
		                    div.innerHTML += "<td>" + data[i].FirstBuyDay + "</td>";
		                    div.innerHTML += "<td>" + data[i].avgcost + "</td>";
		                    div.innerHTML += "<td>" + data[i].nowlot + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowshizhi + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowbenjin + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowhongli + "</td>";
		                    div.innerHTML += "<td>" + data[i].Nowyishuhui + "</td>";
		                    div.innerHTML += "<td>" + data[i].jiufupf + "</td>";
		                    div.innerHTML += "</tr>";
		                });
		            },
		            error: function(XMLHttpRequest, textStatus, errorThrown) {
		                alert(textStatus);
		            },
		            cache: false
		        });

	    }
	</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    	<div id="NowFundList">
    	
		&nbsp;</div>
    	<div id="HistoryFundList">
    	
		&nbsp;</div>
		&nbsp;</div>
    <asp:Repeater ID="now" runat="server">
    <HeaderTemplate>
<table>
<tr>
<td>ID</td>
<td>jjdm</td>
<td>bzdm</td>
<td>jjjc</td>
<td>tzdx</td>
<td>Nowshuhuiyingkui</td>
<td>Nowshouyilv</td>
<td>FirstBuyDay</td>
<td>avgcost</td>
<td>nowlot</td>
<td>Nowshizhi</td>
<td>Nowbenjin</td>
<td>Nowhongli</td>
<td>Nowyishuhui</td>
<td>jiufupf</td>
</tr>
    
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
<td><%# DataBinder.Eval(Container, "DataItem.ID")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.jjdm")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.bzdm")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.jjjc")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.tzdx")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Nowshuhuiyingkui")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Nowshouyilv")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.FirstBuyDay")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.avgcost")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.nowlot")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Nowshizhi")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Nowbenjin")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Nowhongli")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Nowyishuhui")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.jiufupf")%></td>
</tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </FooterTemplate>
    </asp:Repeater>
    <asp:Button ID="Button1" runat="server" Text="深圳中行现有基金列表" onclick="Button1_Click" />
    
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    
    <asp:Repeater ID="history" runat="server">
    <HeaderTemplate>
    <table>
<tr>
<td>ID</td>
<td>jjdm</td>
<td>bzdm</td>
<td>jjjc</td>
<td>tzdx</td>
<td>Historyshuhuiyingkui</td>
<td>Historyshouyilv</td>
<td>FirstBuyDay</td>
<td>avgcost</td>
<td>Historylot</td>
<td>Historyshizhi</td>
<td>Historybenjin</td>
<td>Historyhongli</td>
<td>Historyyishuhui</td>
<td>jiufupf</td>
</tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
<td><%# DataBinder.Eval(Container, "DataItem.ID")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.jjdm")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.bzdm")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.jjjc")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.tzdx")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Historyshuhuiyingkui")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Historyshouyilv")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.FirstBuyDay")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.avgcost")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Historylot")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Historyshizhi")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Historybenjin")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Historyhongli")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.Historyyishuhui")%></td>
<td><%# DataBinder.Eval(Container, "DataItem.jiufupf")%></td>
</tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </FooterTemplate>
    </asp:Repeater>
    <asp:Button ID="Button2" runat="server" Text="深圳中行历史基金列表" onclick="Button2_Click" />
    <asp:Button ID="Button3" runat="server" Text="重新计算" onclick="Button3_Click" />
    <div>
    
            <cc1:LineChart runat="server" ID="LineChart1"></cc1:LineChart>
    </div>
    </form>
    
    
</body>
</html>
